#pragma once
class CListMsg;
class CBuffer;
class DBSocket
{
public:
	DBSocket(void);
	~DBSocket(void);
	static DBSocket& Inst();
	void	ExecuteOpcode(tagMessage* m);
	bool	Init();
	bool	Stop();
	int		SendMSG2DB(void* lp, DWORD dwSize);
	void	HandleDBMsg();
	static DWORD WINAPI RecvDBMsgThread(LPVOID lp);
	static DWORD WINAPI ConnectDBThread(LPVOID lp);
	void	HandlePlayerAuthResult(tagMessage* m);
private:
	bool	m_bRun;
	SOCKET	m_Sock;
	HANDLE	m_hRecvDBMsg;
	HANDLE	m_hConnectDB;
	CListMsg* m_pDBMsgList;
	CBuffer* m_pBuffer;
};
extern DBSocket sDBSocket;
